package Cards;

import java.util.Iterator;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lenovo
 * Date: 2022-07-23
 * Time: 9:11
 */
public class Test {
    public static void main(String[] args) {
        CardDemo cardDemo = new CardDemo();
        List<Card> ret = cardDemo.buyDeskCard();
        System.out.println(ret);
        System.out.println("洗牌：");
        cardDemo.shellu(ret);
        System.out.println(ret);
        System.out.println("发牌：" );

        List<List<Card>> hands =cardDemo.idea(ret);
        System.out.println("====for循环打印=====");
        for (int i = 0; i < hands.size(); i++) {
            System.out.println("第"+i+"个人的牌："+hands.get(i));

        }
        System.out.println("====for each=====");
        for (List<Card> hand :hands) {
            System.out.println(hand);
        }
        System.out.println("====迭代器====");
        Iterator<List<Card>> it = hands.iterator();
        while (it.hasNext()){
            System.out.println(it.next());
        }

    }
}
